OpenDriver
OpenDriver Open the device driver specified by name
#include <Devices.h> Device Manager
OSErr OpenDriver( driverName, refNum );
Str255 driverName ; address of device driver name
short *refNum ; receives device driver reference number
returns Error Code; 0=no error
OpenDriver opens the device driver specified by name for reading and
writing. It returns the driver's reference number.
driverName is the address of a pascal-style string containing the name of the
device driver to be opened.
refNum is the address of a 16-bit short. Upon return, it will contain the
device driver reference number. This value is used in all subsequent
operations on the open driver.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
badUnitErr (-21) refNum doesn't match unit table
unitEmptyErr (-22) refNum specifies NIL handle in unit table
openErr (-23) Requested Read/Write permission and the driver's Open
permissions don't match
dInstErr (-26) Couldn't find driver in resource file

Notes: While the Sound Driver and Disk Driver open at system startup time, the
rest of the drivers are opened at the specific request of an application.
Before a driver is opened, you refer to it by name. After opening, it is
henceforth known by its reference number.